/*
 * GenModExp.h
 *
 *  Created on: Sep 26, 2012
 *      Author: calle
 */

#ifndef GENMODEXP_H_
#define GENMODEXP_H_
#include <AbsSyn/AbsSyn.h>
#include <Generator/GenExp.h>
#include <AbsSyn/ModulusExp.h>
#include <Interfaces/IGenExp.h>

class GenModExp: public IGenExp {
private:
	AddExp::genAddExp m_GenFun;

public:
	GenModExp(AddExp::genAddExp genFun):
		m_GenFun(genFun)
	{

	}
	virtual ~GenModExp(){}

	virtual AbsSyn::IExpPtr genExp( GenExp::GenExpPtr genExpPtr) const{
		return m_GenFun(*genExpPtr);
	}
	virtual int getExpNrArg() const{
		return 2;
	}
	virtual bool isTypeMatch(TypeEnum type) const{
		bool ret = false;

		if( type == TypeEnum::IntT )
		{
			ret = true;
		}

		return ret;
	}

};



#endif /* GENMODEXP_H_ */
